home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 October / EnigmA AMIGA RUN 31 (1998)(G.R. Edizioni)(IT)[!][issue 1998-10].iso / earkit / chat / amirc_20 / rexx / isop.amirx < prev    next >
Text File  |  1998-09-22  |  2KB  |  63 lines

  1. /* ISOP.amirx by Ariel Magnum
  2. ** How to check if a user is opped
  3. ** Provides a function to paste to your script
  4. */
  5. Options Results  /* Enable rc/result return codes */
  6. signal on syntax /* Enables syntax checking       */
  7. prefix='ISOPDemo'/* Prefix for echos              */
  8. colour=3         /* Colour fo echos               */
  9.  
  10. /* Begin */
  11.  
  12.  
  13. /* This is how it works */
  14. "GETMYNICK"
  15. mynick=result
  16.  
  17. "GETUSERS"
  18. users=result
  19.  
  20. if find(users,'@'mynick) ~= 0 then cecho("You are opped")
  21. if find(users,'@'mynick) =  0 then cecho("You are not opped")
  22. if find(users,'+'mynick) ~= 0 then cecho("You are voiced")
  23. if find(users,'+'mynick) =  0 then cecho("You are not voiced")
  24.  
  25. /* how to call the function */
  26.  
  27. "GETCHANNEL"
  28. channel=result /* You need to provide a channel */
  29. "GETSELECTEDUSER CHANNEL="channel
  30. nick=result    /* And a nick - for this example
  31.                   we give it the selected user  */
  32.  
  33. if isop(channel,nick) then cecho("User" bold(nick) "is opped")
  34. else cecho("User" nick "is not opped")
  35.  
  36. /* End   */
  37. exit
  38.  
  39. /* Shared Functions */
  40. isop:
  41. "GETUSERS CHANNEL="arg(1)
  42. if find(upper(result),'@'upper(arg(2)))~==0 then return 1
  43. return 0
  44.  
  45. bold:      /* This function bolds text*/
  46. return '02'x||arg(1)||'02'x
  47.  
  48. underline: /* This function underlines text*/
  49. return '1F'x||arg(1)||'1F'x
  50.  
  51. inverse:   /* This function inverses text*/
  52. return '16'x||arg(1)||'16'x
  53.  
  54. cecho:     /* This function echo's text to listview*/
  55. "ECHO P="d2c(27)"b«"prefix"» C="colour arg(1)
  56. return 0
  57.  
  58. syntax:   /* This function returns where you made a syntax error */
  59. prefix="Syntax"
  60. cecho("Command on line" SIGL "returned" RC ":" errortext(rc) sourceline(SIGL))
  61. exit
  62.  
  63.